package com.info.zhiduoduo.repository.entity.crowdsource;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 智零工商户流水记录表
 * @author tianyonghong
 * @create 2023/2/22
 */
@Data
@Accessors(chain = true)
@TableName("zdd_odd_job_merchant_flow")
public class OddJobMerchantFlow extends Model<OddJobMerchantFlow> {

    private static final long serialVersionUID = 1L;

    /**
     * 智零工商户流水记录表id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("来源单号")
    private Integer sourceId;

    /**
     * '流水单号'
     */
    @ApiModelProperty("流水单号")
    @TableField("flow_no")
    private String flowNo;

    /**
     * '商户主体ID'
     */
    @ApiModelProperty("商户主体ID")
    @TableField("merchant_id")
    private Integer merchantId;

    @ApiModelProperty("客户主体id")
    @TableField("party_id")
    private Integer partyId;

    /**
     * 流水类型(1:充值；2:红冲；3:发布项目)
     */
    @ApiModelProperty("流水类型(1:充值；2:红冲；3:发布项目)")
    @TableField("flow_type")
    private Integer flowType;

    /**
     * '交易金额'
     */
    @ApiModelProperty("交易金额")
    @TableField("flow_amount")
    private BigDecimal flowAmount;

    /**
     * 记录前账户余额,用于核对账户
     */
    @ApiModelProperty("记录前账户余额,用于核对账户")
    @TableField("before_balance")
    private BigDecimal beforeBalance;

    /**
     * 记录后账户余额,用于核对账户
     */
    @ApiModelProperty("记录后账户余额,用于核对账户")
    @TableField("curr_balance")
    private BigDecimal currBalance;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @TableField("create_time")
    private Date createTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
